<?php
set_time_limit(0);
include_once "../config.php";
$Connect = new PDO('mysql:host='.$db['host'].';dbname='.$db['database'], $db['user'], $db['pass']);
$Connect->query("set names 'utf8'");
$sql = "select `face_id` , source from `face_resource` where width is null order by face_id ";
$exec = $Connect->query($sql);
$result = $exec->fetchAll(PDO::FETCH_ASSOC);
foreach($result as $img) {
	$imgName = $img['source'];
	$size = getimagesize($imgName);
	if($size[0] > 0) {
		$sql_I = "update `face_resource` set `width` = '".$size[0]."' , `height` ='".$size[1]."' where `face_id` = '".$img['face_id']."' limit 1";
		if($Connect->query($sql_I)) {
			echo $img['face_id'];
			echo "<br />";
			ob_get_contents();
			ob_flush();
			continue;
		} else {
			echo $img['face_id'];
			echo "<br />";
			ob_get_contents();
			ob_flush();
			var_dump($Connecth->errorInfo());exit;
		}
	}
}

?>